package cn.com.chengmandian.bike.service.impl;

import cn.com.chengmandian.bike.model.EbRentCombo;
import cn.com.chengmandian.bike.mapper.EbRentComboMapper;
import cn.com.chengmandian.bike.service.IEbMemberPayService;
import cn.com.chengmandian.bike.service.IEbMessageInfoService;
import cn.com.chengmandian.bike.service.IEbRentComboService;
import cn.com.chengmandian.bike.service.IEbRentOrderService;
import cn.com.chengmandian.core.common.constants.CommonConstant;
import cn.com.chengmandian.core.redis.cache.AgentCacheService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 电单车运营-分时租赁-套餐信息 服务实现类
 * </p>
 *
 * @author AutoGenerator
 * @since 2023-07-10
 */
@Service
public class EbRentComboServiceImpl extends ServiceImpl<EbRentComboMapper, EbRentCombo> implements IEbRentComboService {

    @Autowired
    private IEbMemberPayService memberPayService;
    @Autowired
    private IEbRentOrderService rentOrderService;
    @Autowired
    private AgentCacheService agentCacheService;
    @Autowired
    private IEbMessageInfoService messageInfoService;

    @Override
    public List<EbRentCombo> enable(Integer areaId) {
        return this.list(new LambdaQueryWrapper<EbRentCombo>().eq(EbRentCombo::getAreaId, areaId).eq(EbRentCombo::getIsDeleted, CommonConstant.ZERO).eq(EbRentCombo::getIsEnabled, CommonConstant.ONE));
    }

    @Override
    public EbRentCombo detail(Integer id) {
        return this.getById(id);
    }
}
